package cn.tedu.sp09.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import cn.tedu.sp01.pojo.User;
import cn.tedu.web.util.JsonResult;

@FeignClient(name="user-service", fallback = UserFeignClientFB.class)
public interface UserFeignClient {
	@GetMapping("/{userId}")
	JsonResult<User> getUser(@PathVariable Integer userId);
	
	/*
	 * 新版本中必须加 @RequestParam
	 */
	@GetMapping("/{userId}/score")   //  /{userId}/score?score=1000
	JsonResult<?> addScore(@PathVariable Integer userId, @RequestParam Integer score);
}
